import VueRouter from 'vue-router'

//导入对应的路由组件
import HomeComponent from './components/tabbar/HomeComponent.vue'
import ActionComponent from './components/tabbar/ActionComponent.vue'
import MineComponent from './components/tabbar/MineComponent.vue'
import StoreComponent from './components/tabbar/StoreComponent.vue'
// import LocationChoose from './components/maps/LocationChoose.vue'

//测试城市选择部分
import City from './components/city/City.vue'
//测试添加爱车部分
import Car from './components/car/Car.vue'
//爱车型号选择部分
import CarSelectCc from './components/car/components/CarSelectCc.vue'
//爱车年份选择部分
import CarSelectYear from './components/car/components/CarSelectYear.vue'
//爱车添加车牌部分
import CarId from './components/car/components/CarId.vue'
//我的爱车
import UserCar from './components/car/components/UserCar.vue'
//选择爱车服务
import SelectService from './components/service/SelectService.vue'

// 3. 创建路由对象
var router = new VueRouter({
  routes: [
    { path: '/', redirect: '/home' },
    { path: '/home', component: HomeComponent },
    { path: '/action', component: ActionComponent },
    { path: '/mine', component: MineComponent, name: 'mine' },
    { path: '/store', component: StoreComponent },
    // { path: '/home/location', component: LocationChoose },//测试城市选择部分
    { path: '/home/location', component: City, name: 'location' },
    { path: '/store/location', component: City },
    { path: '/home/addCar', component: Car },
    { path: '/home/addCar/carSelectCc', component: CarSelectCc },
    { path: '/home/addCar/carSelectCc/carSelectYear', component: CarSelectYear },
    { path: '/home/addCar/carSelectCc/carSelectYear/addCarId', component: CarId },
    { path: '/home/userCar', component: UserCar },
    { path: '/selectService', component: SelectService }
  ],
  linkActiveClass: 'mui-active' //覆盖默认的路由高亮的类，默认的类叫做router-link-active
})

// 把路由对象暴露出去
export default router